package com.dream;

import java.util.HashMap;
import java.util.Map;

import com.dream.game.model.actor.instance.L2PcInstance;

public class Message
{
	public static enum MessageId
	{
		MSG_CHAR_SUCCESS_BAN("Character %s was successfully blocked."),
		MSG_CHAR_SUCCESS_UNBAN("Character %s unbanned."),
		MSG_ACC_RECIVE_GM_ACCESS("Accound %s recive gm rights."),
		MSG_CHAT_BLOCK_FOR("Chat blocked for %s."),
		MSG_YOUR_CHAT_BLOCK_FOR("Chat %s is blocked for you."),
		MSG_CHAT_UNBLOCK("Block removed for %s."),
		MSG_YOUR_CHAT_UNBLOCK("Chat unblocking."),
		MSG_ALL_CHAT_BLOCK("All chats are blocked. %s minute(s) left."),
		MSG_ALL_CHAT_UNBLOCK("All chats are enabled."),
		MSG_BAN_ACC_BREAK_RULE("Account %s blocked."),
		MSG_UNBAN_ACC("Account %s unbanned."),
		MSG_SEND_IN_JAIL("Player %s jailed."),
		MSG_ADMIN_PUT_YOU_IN_JAIL("You are jailed by %s."),
		MSG_SET_ALL_ARG("Agruments are wrong."),
		MSG_CHAR_NOT_FOUND_IN_BASE("Player not found in DB."),
		MSG_CHAR_NOT_FOUND("Player not found."),
		MSG_RELEASE_FROM_JAIL("Player %s unjailed."),
		MSG_YOU_RELEASED_FROM_JAIL("You are left jail."),
		MSG_TARGET_NOT_FOUND("Target not found."),
		MSG_NOT_ALLOWED_AT_THE_MOMENT("Not avaliable now."),
		MSG_CANNOT_FIND_RECIPIENT("Unable to find %s for as letter reciver."),
		MSG_INCOMING_MAILBOX_FULL("%s, your inbox is full."),
		MSG_TARGET_IS_IN_JAIL("Player in jail."),
		MSG_TARGET_CHAT_BLOCK("Player's chat is blocked."),
		MSG_YOU_ARE_IN_JAIL("You are in jail."),
		MSG_TARGET_IS_AWAY("%s away."),
		MSG_NO_SPAWN_FOUND("Spawn not found."),
		MSG_INSUFFICIENT_RIGHT("You have no rights."),
		MSG_GM_COMMAND_NOT_EXIST("Command '%s' not exists."),
		MSG_NO_RIGHTS_USE_COMMAND("Command '%s' disabled for you."),
		MSG_LOST_GM_RIGHTS("You are lost admin rights."),
		MSG_EARN_GM_RIGHTS("You admin rights renewed."),
		MSG_ERROR_TRY_LATER("Error, try later."),
		MSG_HERO_CHAT_ONCE_PER_TEN_SEC("Denied. You can write hero chat once per 10 seconds."),
		MSG_CHAT_FLOOD_PROTECT("Flooding. Try later."),
		MSG_CHAR_BUSY_TRY_LATER("Player is busy. Try later."),
		MSG_CURRENT_IN_COMBAT("You are in combat"),
		MSG_YOU_OPEN("You open %s."),
		MSG_YOU_FAILD_OPEN("You are not open %s."),
		MSG_DOOR_OPEN("Door is open!"),
		MSG_ACTION_NOT_ALLOWED_DURING_SHUTDOWN("Not allow while restarting"),
		MSG_MERCHANT_FUNC_ONLY_IN_CASTLE("Seller avaliable in %s castle."),
		MSG_WRONG_PUMPKIN("It's not your squash."),
		MSG_SQUASH_SUCCESS_GROW("Squash is grow."),
		MSG_RECIPE_ADD_DWARV("Recipie '%s' added for dwarven craft."),
		MSG_RECIPE_ADD_COMMON("Recipie '%s' added for common craft."),
		MSG_CANNOT_USE("You cant't use %s."),
		MSG_MISER_CONSUME("SA consume %d soulshots."),
		MSG_CANNOT_GROW_PUMPKIN("Squash is not growing."),
		MSG_CANNOT_OPEN_PORTAL("You can't pass here."),
		MSG_USE_BLOCK_BUFF("Buff is blocked."),
		MSG_BLOCK_BUFF("Buff blocking is %s."),
		MSG_CANNOT_REMOVE_WEAPON("You can't remove weapon while casting."),
		MSG_FISHING_IS_NOT_ALLOWED("Fishing disabled."),
		MSG_YOU_CANNOT_ESCAPE("You cant't escape."),
		MSG_YOU_USE_ESCAPE("You are use escape: %s."),
		MSG_RESTART_POINT_AT("Restart in %s"),
		MSG_NO_PARTY("You not in party."),
		MSG_PARTY_MEMBERS_COUNT("Members: %s/9"),
		MSG_NOT_ACCESSABLE("Unavaliable."),
		MSG_IP_REC("IP bind: %s."),
		MSG_FORBIDEN_BY_ADMIN("Disabled by GM."),
		MSG_ONLY_IN_PEACE_ZONE("Allow in peace zone."),
		MSG_CURRENT_LANG("Current language: %s."),
		MSG_MAMMON_SEARCH_OFF("Seven Signs search is disabled."),
		MSG_MAMMON_TRADER("Merchant of Mammon: %s."),
		MSG_MAMMON_BLACKSMITH("Blacksmith of Mammon: %s."),
		MSG_SERVICE_NEED_TO_ACTIVE("For enabling service required:"),
		MSG_OFFLINE_TRADE_NEED("- set to trade mode."),
		MSG_OFFLINE_CRAFT_NEED("- set to manufacture mode."),
		MSG_NO_PREMIUM("You don't have premium status."),
		MSG_NO_PARTNER("You don't have pathner."),
		MSG_PARTNER_ASK_DIVORCE("You partner request divorce."),
		MSG_HAVE_PARTNER("You are already have partner."),
		MSG_YOU_DIVORCED("You are divorced."),
		MSG_TARGET_IS_MARIED("Player has partner."),
		MSG_PARTNER_MUST_BE_FRIEND("Player not in friendlist."),
		MSG_ASK_YOU_ENGAGE(" send request. Accept?"),
		MSG_ERROR_CONTACT_GM("Error! Call GM now."),
		MSG_PARTNER_NOT_AVAILABLE("Partner not avaliable now."),
		MSG_NOT_REAR_FLAG("You aren't in flag zone!"),
		MSG_WRONG_CLAN_LEVEL("Only %s level clan can participate in siege."),
		MSG_CLAN_AUTO_REGISTERED("Hall owner automaticly registered on siege."),
		MSG_RAINBOW_GO_TO_ARENA("You clan is on competition. Go to arena."),
		MSG_NO_QUEST_ITEMS("You haven't quest items."),
		MSG_RAINBOW_GIVE_DAMMAGE("Squash recive damage."),
		MSG_RAINBOW_HEAl("Squash heal is success."),
		MSG_RAINBOW_DEBAFF("Your opponent is debuffed."),
		MSG_RAINBOW_HEAL_OTHER("Opponent squash healed."),
		MSG_FISHCHAMP_BETTER_RESULT("You result is grow."),
		MSG_FISHCHAMP_WINER_LIST("You are in fishing championship."),
		MSG_BAD_CONDITIONS("Not allowed for you."),
		MSG_LIT_NO_ENTRY("You can't logout now."),
		MSG_LIT_OTHER_GROUP_INSIDE("Another group is already inside the Imperial Tomb."),
		MSG_LIT_NOT_COMMANDER_OR_NO_SCROOL("You aren't the commander of the command channel, or you don't have \"Frintezza's Magic Force Field Removal Scroll\"."),
		MSG_LIT_UNREGISTERED("Warning: You have been removed from the register list."),
		MSG_LIT_NO_SCROOL("You dont have Frintezzas Magic Force Field Removal Scroll."),
		MSG_ALREADY_REGISTERD("You have already registered."),
		MSG_CONDITIONS_NOT_MET("Conditions aren't met."),
		MSG_PETITION_REJECTED("Petition denied, please try again later."),
		MSG_BYSE_BECOUSE_SIEGE("Impossible during the siege."),
		MSG_AUCTION_ERROR("Auction Error!"),
		MSG_AUCTION_TIME_END("The time of auction has expired!"),
		MSG_LOW_CLAN_LEVEL("Level of your clan must be %s or higher."),
		MSG_NO_MORE_BID("You can't bid more than 1 second rate."),
		MSG_CANCEL_AUCTION("Auction has been canceled"),
		MSG_NO_RIGHTS_TO_CONTROLL_CASTLE("You don't have rights to manage the Castle."),
		MSG_WRONG_SKILL_LEVEL_CONTACT_ADMINISTRATOR("Wrong skill level, please contact the Administrator!"),
		MSG_CANT_CHANGE_SIEGE_TIME("Change time of the siege not allow."),
		MSG_HERE_TRAP("Trap is here."),
		MSG_NO_RIGHTS_TO_CONTROLL_HALL("You don't have rights to manage ClanHall."),
		MSG_CURSED_WEAPON_NOT_ALLOW("Cursed weapon not allowed."),
		MSG_NO_REGISTER_WHILE_EVENT("You can't register during the event."),
		MSG_CANT_REGISTER_SCORE_WHILE_EVENT("You can't record the results during the festival."),
		MSG_NO_BLOOD_OFFERINGS("Don't have blood sacrificial to make contribution."),
		MSG_NO_PRISE_TIL_EVENT_ACTIVE("You can't receive the prize during the competition."),
		MSG_CANT_LEAVE_FESTIVAL("Only the group leader can leave the festival, if completed requirement of a minimum numbers of participants."),
		MSG_NO_RIGHTS_TO_CONTROLL_FORT("You don't have rights to manage the fort."),
		MSG_REGISTERD_ON_FORT_SIEGE("Registered for the siege of the fort %s."),
		MSG_PET_UNSUMMON_IN_MINUTES("Your pet will leave you in %s minutes."),
		MSG_FEED_TIME_END("Time of pet expired."),
		MSG_JAIL_POINTS_RESET("Your jail point score is clear."),
		MSG_GO_AWAY("Go away, you arn't welcome here!"),
		MSG_SKILLS_LEARN("%s You have learned new skill."),
		MSG_USE_BACK_COMMAND("To disable the AFK mode type: .back !"),
		MSG_CANT_TARGET_WHEN_TARGET_IN_SIEGE("Can't target players who participate in the siege."),
		MSG_EARN_PVP_BONUS("You have earned reward for the killing in PVP."),
		MSG_SKILL_REMOVED_ADMIN_INFORMED("Removed skills (%s). GM informed!"),
		MSG_WRONG_CLASS("Wrong class!"),
		MSG_REMOVE_FROM_PARTY_BIG_LVL_DIF("You are removed from the group because, large difference in the level."),
		MSG_ENTER_IN_INVUL_MODE("Enter in invulnerable mode."),
		MSG_ENTER_IN_INVIS_MODE("Enter in invisible mode."),
		MSG_ENTER_IN_REFUS_MODE("Enter in refusal mode."),
		MSG_CANT_EXIT("Can't leave the game."),
		MSG_REQUEST_OK("Your request accepted."),
		MSG_REQUEST_CANCELED("Your request canceled."),
		MSG_YOU_JAILED_FOR_X_MINUTES("You are sent to jail for %s minutes."),
		MSG_YOU_JAIL_StATUS_UPDATED("Your status updated to %s minutes."),
		MSG_OFFLINE_MODE_ON("Offline mode: on!"),
		MSG_OFFLINE_MODE_ON_BUFF("Now you have 10 minutes for put Your's Buff for sell."),
		MSG_FAME_RECIVED("You get reputation points."),
		MSG_NO_NEW_MESSAGE("You don't have messages."),
		MSG_YOU_ARE_BANNED("You are blocked by administrator."),
		MSG_PET_IS_TO_HUNGRY("Your pet can't do this, because it very hungry."),
		MSG_NOT_IN_SIEGE_ZONE("Summon deleted, because it isn't in siege zone."),
		MSG_WAIT_CHANGE_MODE_END("Wait for the change of state of siege mode."),
		MSG_CHANGE_MODE_CANCEL("Change siege mode is canceled."),
		MSG_CHANGE_MODE("Change siege mode is started."),
		MSG_CHANGE_MODE_END("Siege mode is changed."),
		MSG_SPAWN_PROTECTION("You have %s seconds till spawn protection ends."),
		MSG_YOU_IN_OLYMPIAD("You are registered at the Olympiad."),
		MSG_UNSUMMON_YOUR_PET("Unsummon your pet."),
		MSG_MAX_SUB_CLASS("Reached limit of sub-classes."),
		MSG_NO_SUB_CLASS("No available sub-classes."),
		MSG_NEED_ITEM("You must have %s in your inventory."),
		MSG_CANT_ADD_SUB("Sub-class can not be added."),
		MSG_UNRIDE_PET("Unride your pet."),
		MSG_CANT_GIVE_TO_ACADEM("You can't transfer the right leadership in the academy."),
		MSG_NOT_FOUND_IN_CLAN("%s not found in your clan!"),
		MSG_NOW_YOU_MARIED("Congratulations, you are married!"),
		MSG_PARTNER_DECLINE("Your partner refused."),
		MSG_WRONG_STRIDER_LEVEL("Strider hasn't reached the desired level."),
		MSG_BAD_COORDINATS("Bad coordinate contact with the GM!"),
		MSG_ACTION_PET_LEVEL_UP("Pet level increased."),
		MSG_ALREADY_IGNORED("%s is already ignored."),
		MSG_NOT_IN_IGNOR_LIST("%s not in ignore list."),
		MSG_CANT_PICK_UP_WHILE_RIDING("You can't pick up item while you're riding."),
		MSG_YOU_OUT_BIDDED("Your bid was interrupted."),
		MSG_YOU_WIN_AUCTION("Congratulations! You have won an auction for the clan hall!"),
		MSG_CASTLE_TAX_RANGE("The tax can be changed from 0 to %s."),
		MSG_CASTLE_CHANGE_TAX("The tax will be changed to %s %%."),
		MSG_DUEL_CANCELED_DUE_PVP("Duel canceled because the enemy went into PVP mode."),
		MSG_EVENT_CTF_TAKE_FLAG_TO_BASE("Take the flag to its base."),
		MSG_EVENT_REGISTERED("You registered in event %s."),
		MSG_EVENT_CANT_REGISTERED("Your participation at event is impossible."),
		MSG_EVENT_CANCEL_REG("Your participation in event %s as canceled."),
		MSG_EVENT_NOT_REGISTERED("You are not a event member."),
		MSG_EVENT_WAIT_FOR_RES("You are dead, wait for resurrection."),
		MSG_EVENT_YOU_KILL_TEAM_MEMBER("You killed a member of your team."),
		MSG_EVENT_YOU_KILL_REGULAR_PLAYER("You have killed a enemy player."),
		MSG_EVENT_CANT_USE_ITEM("You may not use this item on event."),
		MSG_EVENT_SKILL_NOT_ALOWED("This skill is prohibited on event."),
		MSG_EVENT_NOT_ALLOWED("Sorry, the Event is not available."),
		MSG_EVENT_ALREADY_REGISTERED("You have already registered on the Event."),
		MSG_EVENT_FULL("Event slot's is full, try next Event."),
		MSG_EVENT_WRONG_LEVEL("Your level is not suitable for participation. "),
		MSG_EVENT_RECIVE_KILL_BONUS("You have received a reward for murder."),
		MSG_NO_QUEST("<html><body>You do not meet the minimum requirements of NPC or quest. Maybe you made a mistake when turned to the NPC.</body></html>"),
		MSG_OLY_END("The great Olympics is completed."),
		MSG_OLY_NEW_PERIOD("The new period of the great Olympics started."),
		MSG_POINTS_REQUIRE("You can't take part, you must have %d points."),
		MSG_YOU_CANT_DOIT_AT_THIS_TIME("At present it is not possible to do this."),
		MSG_RELEASE_PET("Free the servant or pet"),
		MSG_OLY_PREPARE("Preparation"),
		MSG_OLY_SAME_IP("Match interrupted because of both parties is the same as the IP address."),
		MSG_OLY_INGAME("In the game "),
		MSG_OLY_WAIT("Waiting For "),
		MSG_REG_FAIL("Your registration is canceled due to an unexpected error."),
		MSG_FORT_ATTACKED("On your fortress was attacked! "),
		MSG_NOT_ENOUGH_CLAN_MEMBERS("To participate in the attack in the clan should be% s or more members of the clan."),
		MSG_JAIL_POINT_EARNED("You have %s prison points."),
		MSG_JAIL_POINTS_ALL("you got all the points, talk to the manager. "),
		MSG_JAIL_POINT_LOST("%s you lose points after prison deaths."),
		MSG_CW_YOUR_LVL_LOW("Attack of the newcomers this weapon is prohibited."),
		MSG_BUFF_PROTECTED("You have protection for no lose buffs."),
		MSG_CW_TARGET_LVL_LOW("Attack the newbies this weapon is prohibited."),
		MSG_FACTION_CANT_CHANGE_TITLE("Faction System: the title is prohibited. "),
		MSG_TARGET_RECIVE_SPECIAL_EFFECT("Target takes special skill to arms!"),
		MSG_EVT_1("%s: Registration Period Started."),
		MSG_EVT_2("%s: Level difference (%d-%d)."),
		MSG_EVT_3("%s: Reward:"),
		MSG_EVT_4("%s: Event will Start in %d minutes."),
		MSG_EVT_5("%s: Registration period end in %d minutes."),
		MSG_EVT_6("%s: Registration period is less than minute, hurry up!!!"),
		MSG_EVT_7("%s: Team %s wins, with %d points, Congratulations!"),
		MSG_EVT_8("%s: Event have no winners, prepare for next Battle."),
		MSG_EVT_9("%s: Not enough players, scheduling next Event."),
		MSG_EVT_10("%s: Battle Started go Kill your Enemy!"),
		MSG_EVT_11("%s: Player %s wins, with %d kills."),
		MSG_EVT_12("Kills %d"),
		MSG_EVT_13("%s: Register using .tvtjoin or .tvtleave to cancel."),
		MSG_EVT_14("%s: Register using .ctfjoin or .ctfleave to cancel."),
		MSG_EVT_15("%s: Register using .dmjoin or .dmleave to cancel."),
		MSG_YOU_CANT_PICKUP_MERCH_IN_PARTY("You cannot pickup mercenaries while in a party."),
		MSG_CANT_CREATE_SUB_UNITS("You can't create any more sub-units of this type."),
		MSG_LEADER_IS_INCORECT("Leader is not correct"),
		MSG_CREATE_ALLIANCE("Alliance %s has been created."),
		MSG_LVL_DIFF_TO_HIGH_TO_INVITE("Level difference too high, you can't invite this player."),
		MSG_LVL_DIFF_TO_HIGH_TO_JOIN("Level difference too high, you can't join this party."),
		MSG_SKILL_NOT_IMPLEMENTED("Skill not implemented. Skill ID: %s"),
		MSG_WEAPON_MAY_USE_WITH("may use with"),
		MSG_YOU_NOT_PET_OWNER("You are not the owner of this pet"),
		MSG_COMMAND_IS_NULL("Command is null..."),
		MSG_MAP_NOT_ALLOWED("Map not available."),
		MSG_NO_CHAT("You have entered the zone, where the chat is forbidden."),
		MSG_ENTER_TRADE_ZONE("You are entered in the area of trade restrict."),
		MSG_CANT_CREATE_INSTANCE("Selected instance can not be created."),
		MSG_MAP_ON("Map available."),
		MSG_EXIT_TRADE_ZONE("You have left the area of trade restricted."),
		MSG_PREMIUM_ON("Premium service is enabled."),
		MSG_YOU_ARE_HERO_NOW("You have received hero status."),
		MSG_SEX_CHANGE("Your gender is successfully changed."),
		MSG_WRONG_TITLE("Invalid title, try again."),
		MSG_NICK_EXIST("This nickname is already taken."),
		MSG_WRONG_NICK("Invalid nickname."),
		MSG_NICK_CHANGED("your user name changed successfully."),
		MSG_ILLEGAL_ACTION_KICK("You are removed from the game for the violation. The Administrator informed."),
		MSG_ILLEGAL_ACTION_BAN("You are removed from the game and banned for the violation. The Administrator informed."),
		MSG_ILLEGAL_ACTION_JAIL("You have been convicted of a violation, moved into a place serving the sentence."),
		MSG_SKILL_CHANS_SUCCES("Chance of skill: %s %%, successfully."),
		MSG_SKILL_CHANS("Chance of skill: %s %%."),
		MSG_YOU_WILL_MOVED_IN_TOWN("You'll be moved to the nearest town."),

		ANNOUNCE_CHAR_BLOCKED("player %s blocked access to the server."),
		ANNOUNCE_CHAR_UN_BLOCKED("player %s is allowed access to the server."),
		ANNOUNCE_CHAR_CHAT_BLOCK("Banned player chat %s for %d minutes."),
		ANNOUNCE_CHAR_CHAT_UNBLOCK("player %s unlocked chat."),
		ANNOUNCE_BAN_REASON("ban reason: %s."),
		ANNOUNCE_CHAT_BLOCK_WITH_REASON("%s banned player chat in% d minutes, reason: %s."),
		ANNOUNCE_CHAT_BLOCK_FOREVER_WITH_REASON("player %s chat is banned indefinitely, the reason: %s."),
		ANNOUNCE_ADMIN_BLOCK_ALL_CHAT("All chats are disabled Administration to %s minutes."),
		ANNOUNCE_ADMIN_UNBLOCK_ALL_CHAT("all chats work resumed."),
		ANNOUNCE_ACCOUNT_BLOCK("%s. Violation of the rules."),
		ANNOUNCE_ACCOUNT_UNBLOCK("Account %s unlocked"),
		ANNOUNCE_CHAR_JAIL("Player %s sent to jail %s."),
		MSG_EVT_DAY1("La2Day event started!"),
		MSG_EVT_DAY2("Collect: Lineage II or CHRONICLE or THRONE!"),
		MSG_EVT_CHRISTMAS1("Christmas event started."),
		MSG_EVT_CHRISTMAS2("Help Santa and revcive reward!"),
		MSG_EVT_MEDALS1("Medals event started!."),
		MSG_EVT_MEDALS2("Hunt monsters and collect medals!"),
		MSG_EVT_STAR1("StartLight Festival started!"),
		MSG_EVT_STAR2("Collect starpices and recive reward"),
		MSG_EVT_SQUASH1("Big Squash event started!"),
		MSG_EVT_SQUASH2("Grow squashes and recive reward!");

		String _msg;

		MessageId(String msg)
		{
			_msg = msg;
		}

		public String getText()
		{
			return _msg;
		}

	}

	private static Map<String, Map<MessageId, String>> _messages = new HashMap<>();

	public static String getMessage(L2PcInstance player, MessageId msgId)
	{
		String lang = player == null ? "en" : player.getLang();
		Map<MessageId, String> msgList = _messages.get(lang);
		if (msgList == null)
			return msgId.getText();
		if (!msgList.containsKey(msgId))
			return msgId.getText();
		return msgList.get(msgId);

	}

	public Message()
	{

	}
}